﻿<?php include "coresection/connection.php";?>
<?php include "coresection/checkUserSession.php";?>
<?php include "coresection/order-list.php";?>
<?php include "coresection/department-list.php"?>
<?php include "coresection/search-admin.php";?>

<?php include "coresection/product-list-function.php";?>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <?php include 'modules/head.php'; ?>
</head>

<body>
<?php include 'modules/topbar.php'; ?>




<div class="setup_area">


    <?php include 'modules/sidebar.php'; ?>

    <div class="header">
        <h1>员工满意度调查表</h1>
        <?php include 'modules/header.php'; ?>
    </div>



<div class="content_area">



<div class="feed_back_box">



 <?

 //统计今天是否已经提交统计表
 $table = "feedback";
 $query = mysql_query("select count(nid) from $table where user_id = '$user_id' and datetime = '$todayDate'");
 $sum = mysql_result($query, 0);


 //统计今天是否有订餐
 $table = "orderlist";
 $query = mysql_query("select count(nid) from $table where user_id = '$user_id' and order_date = '$todayDate'");
 $ordersum = mysql_result($query, 0);



 if(($sum) || (!$ordersum) ){

     ?>

     <div class="content">
         <ol>
             <li>你当天已经提交订单或当日未点餐</li>
         </ol>
     </div>



     <?
 }

 else {

     ?>


    <div class="feed_back_box_content">
        您好！为了解我单位食堂服务总体情况，进一步提高食堂的工作质量，营造和谐的就餐环境和改善大家的生活条件，使广大职工能得到更好的饮食服务。请您为对应的项目选择平分,以便我们改进工作，谢谢合作！
    </div>


    <?php
    //提交表格之后消灭session，付款完之后如果没有session，就跳转会填表页面。
    session_start();//根据当前SESSION生成随机数
    $code = true;
    $_SESSION['code'] = $code;
    ?>




    <form id="feedback_form"  onsubmit="return test();" method="post" action="coresection/admin-feedback-add.php" enctype="multipart/form-data"
          name="uploadfile">





<input type="hidden" value="<? echo $todayDate ?>" name="datetime"/>
<input type="hidden" value="<? echo $user_id ?>" name="user_id"/>
<input type="hidden" value="<? echo $user_name ?>" name="user_name"/>


<ol class="detail-boxing">


<li class="q1">


            <h6>你经常在我单位饭堂就餐吗？</h6>

            <div class='radio-box'>
                <input name='q1' type='radio'  value='10' id="q1-1" style="width:20px; height:20px" />
                <label for="q1-1"><span>每次都在</span></label>

                <input name='q1' type='radio' value='8'  id="q1-2" style="width:20px; height:20px" />
                <label for="q1-2"><span>基本在</span></label>

                <input name='q1' type='radio' value='6'  id="q1-3" style="width:20px; height:20px" />
                <label for="q1-3"><span>偶尔在</span></label>

                <input name='q1' type='radio' value='0'  id="q1-4" style="width:20px; height:20px" />
                <label for="q1-4"><span>从不</span></label>
            </div>


</li>




    <li class="q2">


        <h6>你觉得食堂的饭菜价格怎样？</h6>

        <div class='radio-box'>
            <input name='q2' type='radio' value='10' id="q2-1" style="width:20px; height:20px" />
            <label for="q2-1" ><span>可以接受</span></label>

            <input name='q2' type='radio' value='8'  id="q2-2" style="width:20px; height:20px"/>
            <label  for="q2-2" ><span>比较便宜</span></label>

            <input name='q2' type='radio' value='6'  id="q2-3" style="width:20px; height:20px"/>
            <label  for="q2-3" ><span>一般</span></label>

            <input name='q2' type='radio' value='0'  id="q2-4" style="width:20px; height:20px"/>
            <label for="q2-4"  ><span>很贵</span></label>
        </div>


    </li>



    <li class="q3">


        <h6>你对食堂的卫生情况是否满意</h6>

        <div class='radio-box'>
            <input name='q3' type='radio' value='10'  id="q3-1" style="width:20px; height:20px"/>
            <label for="q3-1" ><span>满意</span></label>

            <input name='q3' type='radio' value='8'   id="q3-2" style="width:20px; height:20px"/>
            <label for="q3-2" ><span>较满意</span></label>

            <input name='q3' type='radio' value='6'   id="q3-3" style="width:20px; height:20px"/>
            <label for="q3-3" ><span>一般</span></label>

            <input name='q3' type='radio' value='0'   id="q3-4" style="width:20px; height:20px"/>
            <label for="q3-4" ><span>不满意</span></label>
        </div>


    </li>





    <li class="q4">


        <h6>你对饭菜的味道是否满意</h6>

        <div class='radio-box'>
            <input name='q4' type='radio' value='10' id="q4-1" style="width:20px; height:20px"/>
            <label for="q4-1" ><span>满意</span></label>

            <input name='q4' type='radio' value='8'  id="q4-2" style="width:20px; height:20px"/>
            <label  for="q4-2"><span>较满意</span></label>

            <input name='q4' type='radio' value='6'  id="q4-3" style="width:20px; height:20px"/>
            <label for="q4-3"><span>一般</span></label>

            <input name='q4' type='radio' value='0'  id="q4-4" style="width:20px; height:20px"/>
            <label for="q4-4"><span>不满意</span></label>
        </div>


    </li>





    <li class="q5">


        <h6>你对饭菜的份量是否满意？</h6>

        <div class='radio-box'>
            <input name='q5' type='radio' value='10' id="q5-1" style="width:20px; height:20px"/>
            <label  for="q5-1"><span>满意</span></label>

            <input name='q5' type='radio' value='8'  id="q5-2" style="width:20px; height:20px"/>
            <label  for="q5-2"><span>较满意</span></label>

            <input name='q5' type='radio' value='6' id="q5-3" style="width:20px; height:20px"/>
            <label  for="q5-3"><span>一般</span></label>

            <input name='q5' type='radio' value='0'  id="q5-4" style="width:20px; height:20px"/>
            <label  for="q5-4"><span>不满意</span></label>
        </div>


    </li>




    <li class="q6">


        <h6>你对饭菜的种类是否满意？</h6>

        <div class='radio-box'>
            <input name='q6' type='radio' value='10'  id="q6-1" style="width:20px; height:20px"/>
            <label  for="q6-1"><span>满意</span></label>

            <input name='q6' type='radio' value='8'  id="q6-2" style="width:20px; height:20px"/>
            <label  for="q6-2"><span>较满意</span></label>

            <input name='q6' type='radio' value='6'   id="q6-3" style="width:20px; height:20px"/>
            <label  for="q6-3"><span>一般</span></label>

            <input name='q6' type='radio' value='0'   id="q6-4" style="width:20px; height:20px"/>
            <label  for="q6-4"><span>不满意</span></label>
        </div>


    </li>





    <li class="q7">


        <h6>你对送餐（打饭）的速度是否满意？</h6>

        <div class='radio-box'>
            <input name='q7' type='radio' value='10' id="q7-1" style="width:20px; height:20px"/>
            <label for="q7-1"><span>满意</span></label>

            <input name='q7' type='radio' value='8'  id="q7-2" style="width:20px; height:20px"/>
            <label for="q7-2"><span>较满意</span></label>

            <input name='q7' type='radio' value='6'   id="q7-3" style="width:20px; height:20px"/>
            <label for="q7-3"><span>一般</span></label>

            <input name='q7' type='radio' value='0'  id="q7-4" style="width:20px; height:20px" />
            <label for="q7-4"><span>不满意</span></label>
        </div>


    </li>




    <li class="q8">


        <h6>你对汤类的质量是否满意？</h6>

        <div class='radio-box'>
            <input name='q8' type='radio' value='10'  id="q8-1" style="width:20px; height:20px"/>
            <label for="q8-1"><span>满意</span></label>

            <input name='q8' type='radio' value='8'  id="q8-2" style="width:20px; height:20px"/>
            <label for="q8-2"><span>较满意</span></label>

            <input name='q8' type='radio' value='6'  id="q8-3" style="width:20px; height:20px"/>
            <label for="q8-3"><span>一般</span></label>

            <input name='q8' type='radio' value='0'  id="q8-4" style="width:20px; height:20px" />
            <label for="q8-4"><span>不满意</span></label>
        </div>


    </li>




    <li class="q9">


        <h6>你对服务员的态度是否满意？</h6>

        <div class='radio-box'>
            <input name='q9' type='radio' value='10'  id="q9-1" style="width:20px; height:20px"/>
            <label for="q9-1"><span>满意</span></label>

            <input name='q9' type='radio' value='8'  id="q9-2" style="width:20px; height:20px"/>
            <label for="q9-2"><span>较满意</span></label>

            <input name='q9' type='radio' value='6'   id="q9-3" style="width:20px; height:20px"/>
            <label for="q9-3"><span>一般</span></label>

            <input name='q9' type='radio' value='0'   id="q9-4" style="width:20px; height:20px"/>
            <label for="q9-4"><span>不满意</span></label>
        </div>


    </li>




    <li class="q10">


        <h6>你对食堂的总体评价如何？</h6>

        <div class='radio-box'>
            <input name='q10' type='radio' value='10'  id="q10-1" style="width:20px; height:20px"/>
            <label   for="q10-1"><span>好</span></label>

            <input name='q10' type='radio' value='8'  id="q10-2" style="width:20px; height:20px"/>
            <label   for="q10-2"><span>较好</span></label>

            <input name='q10' type='radio' value='6'   id="q10-3" style="width:20px; height:20px"/>
            <label   for="q10-3"><span>一般</span></label>

            <input name='q10' type='radio' value='0'  id="q10-4" style="width:20px; height:20px" />
            <label   for="q10-4"><span>不好</span></label>
        </div>


    </li>



            <li class="q11">

                <h6>意见和建议？</h6>
                <textarea name='remark' type='text' ></textarea>

            </li>






            <li class="q12">
                <h6>本日最满意菜式：</h6>

                <? for($_i=0;$_i<$product_sum;$_i++)
                {
                    ?>

                <div class='radio-box'>
                <input name='best_meal' type='radio' value='<? echo $product_names[$_i];?>'  id="q10-4"
                       style="width:20px; height:20px" />
                <label   for="best_meal"><span><? echo $product_names[$_i];?></span></label>
                </div>
                <?
                ;}
                ?>

                <div class='radio-box'>
                    <input name='best_meal' type='radio' value='无'  id="q10-4"
                           style="width:20px; height:20px" />
                    <label   for="best_meal"><span>无</span></label>
                </div>

            </li>

            <li class="q13">
                <h6>本日不受欢迎菜式：</h6>
                <? for($_i=0;$_i<$product_sum;$_i++)
                {
                    ?>

                    <div class='radio-box'>
                        <input name='worst_meal' type='radio' value='<? echo $product_names[$_i];?>'  id="q10-4"
                               style="width:20px; height:20px" />
                        <label   for="worst_meal"><span><? echo $product_names[$_i];?></span></label>
                    </div>
                    <?
                    ;}
                ?>

                <div class='radio-box'>
                    <input name='worst_meal' type='radio' value='无'  id="q10-4"
                           style="width:20px; height:20px" />
                    <label   for="worst_meal"><span>无</span></label>
                </div>

            </li>



</ol>




        <div class="detail-boxing-function">

            <button class="layui-btn login_submit" type="submit" >确认</button>
            <button class="layui-btn" type="Reset">重置</button>
        </div>
    </form>




     <?
 }
 ?>


</div>

    <script type="text/javascript">
        function test(){
        if(
            ($("input[name='q1']").is(':checked') )&&
            ($("input[name='q2']").is(':checked') )&&
            ($("input[name='q3']").is(':checked') )&&
            ($("input[name='q4']").is(':checked') )&&
            ($("input[name='q5']").is(':checked') )&&
            ($("input[name='q6']").is(':checked') )&&
            ($("input[name='q7']").is(':checked') )&&
            ($("input[name='q8']").is(':checked') )&&
            ($("input[name='q9']").is(':checked') )&&
            ($("input[name='q10']").is(':checked') )&&
            ($("input[name='best_meal']").is(':checked') )&&
            ($("input[name='worst_meal']").is(':checked') )
          )
        {
        return true;
        }else{
        alert("您还有没选择的项目")
        return false;
        }}

    </script>

    <?php include 'modules/footer.php'; ?>
</body>
</html>